package com.example.wxminiprogram.mapper;

import com.example.wxminiprogram.pojo.Seller;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface SellerMapper {
    @Select("select count(*) from seller where id = #{id}")
    Integer countById(Integer id);

    @Select("select count(*) from seller where account = #{account} and password = #{password}")
    Integer countByAccountAndPassword(String account,String password);

    @Select("select id from seller where account = #{account}")
    Integer getIdByAccount(String account);
    @Select("select * from seller where id = #{id}")
    Seller getById(Integer id);
    @Insert("insert into seller(account,password) values (#{account},#{password})")
    Integer insertByAccountAndPassword(String account,String password);
    @Select("select count(*) from seller where account = #{account}")
    Integer countByAccount(String account);
}
